<?php

namespace app\controllers;

use Yii;
use yii\web\Controller;
use app\models\Test;
use app\models\Category;
class IndexController extends Controller
{

public function actionIndex(){
$this->layout="layout1";
$category=new Category;
 
$categories=$category->getTree2($category->getData());
 
return $this->render('Index',['categories'=>$categories]);
}

}